package com.thkj.modules.map.controller;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.thkj.common.util.RequestUtil;
import com.thkj.modules.user.service.TblIndividualService;

import dp.R;
import dp.web.BaseAction;

@RestController
@RequestMapping("/backstage/map")
public class MapAction extends BaseAction {
    @Autowired
    TblIndividualService tblIndividualService;

    @RequestMapping("")
    public ModelAndView index() {
        return new ModelAndView("map/map");
    }

    @RequestMapping("/query")
    public R query(HttpServletRequest request) {
        Map<String, Object> param = RequestUtil.getParameterMap(request);
        List<Map> list = tblIndividualService.queryNoPage( param);
        return R.success(list);
    }

    @RequestMapping("/getIndividualTotal")
    public R individualTotal(HttpServletRequest request) {
        //经营户总数量
        Integer individualTotal = tblIndividualService.count();
        return R.success(individualTotal);
    }
}